1. Field of the Invention
The present invention relates to a flash memory controller, a flash memory system having the controller, and a method for recording data on a flash memory.
2. Description of the Related Art
Recently, flash memories are widely used as semiconductor memories such as memory cards and silicon disks that are used in a memory system. A flash memory is a kind of nonvolatile memories. It is required that data stored in a flash memory be retained even when electric power is not supplied to the flash memory.
A NAND type flash memory is a kind of flash memories used particularly frequently in the memory system described above. Each of a plurality of memory cells included in a NAND type flash memory can change from an erased state where data representing a logic value “1” is stored to a written state where data representing a logic value “0” is stored, independently from the other memory cells. Contrary to this, when at least one of the plurality of memory cells has to change from the written state to the erased state, each memory cell cannot change independently from the other memory cells. At this time, a predetermined number of memory cells included in a so-called block have to change to the erased state simultaneously. This simultaneous erasing operation is generally called “block erasing”. A block which undergoes the block erasing is called “erased block”.
Because of the above-described characteristic, a NAND type flash memory cannot be overwritten with new data. In order to rewrite data stored in a memory cell, it is necessary to write block data containing new data in an erased block, and then execute block erasing for the block storing the old data. The data replacing the old data is written in a block different from the block in which the old data has been stored. Therefore, the correspondence between a logical block address designated by an address signal supplied from a host system and a physical block address indicating the actual block address in the flash memory dynamically changes each time data is rewritten in the flash memory. Accordingly, in a memory system utilizing a flash memory, information regarding the correspondence between the logical block address and the physical block address must be retained.
For example, Unexamined Japanese Patent Application KOKAI Publication No. H10-124384 discloses a flash memory system for writing the logical block address of data written in a block in the redundant area of the block, and managing the correspondence between the logical block address and the physical block address based on the information written in the redundant area.
When a flash memory is to be accessed, an address translation table indicating the correspondence between the logical block address and the physical block address is used. The address translation table is generated with reference to the logical block address written in the redundant area.
As described above, the following two steps are required in order to rewrite data stored in a memory cell. First, block data containing new data is written in an erased block. Second, block erasing is executed for the block in which the old data is stored. Accordingly, as long as erasing of the block in which the old data is written is executed properly, the flash memory is not left in a state where the same logical address is written in the redundant areas of different blocks. However, in a case where the power supply is stopped before block erasing for the block in which the old data is written is executed, the flash memory is left in the state where the same logical address is written in the redundant areas of different blocks. In such a case, it is difficult to determine in the following operation, data written in which block is the new data. As a result, the new data might be erased by mistake.